/**
 * 
 */
package com.ocean.springbootmybatisdemo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ocean.springbootmybatisdemo.pojo.UserInfo;
import com.ocean.springbootmybatisdemo.service.UserService;

/**
 * @author yuqy
 *
 */
@RestController
public class UserController {

	@Autowired
	private UserService userService;

	@GetMapping(value = "/", produces = { "application/json;charset=UTF-8" })
	public String index() {
		return "hello";
	}

	@GetMapping(value = "/hello", produces = { "application/json;charset=UTF-8" })
	public List<UserInfo> hello() {
		List<UserInfo> userInfos = userService.selectAllUser();
		return userInfos;
	}
}
